package com.example.spring_security_demo.Controller;

import com.example.spring_security_demo.test.Service;
import com.example.spring_security_demo.test.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class Hello {
    private final Test test;
    private final Service service;

    @Autowired
    public Hello(Test test,Service service){
        this.test=test;
        this.service=service;
    }

    @GetMapping("/debug")
    public void debug(){
        //service.change();
        System.out.println(test.a);
    }

    @GetMapping("/hello")
    public String hello() {
        return "Hello World";
    }
    @PostMapping("/login1")
    public void login(@RequestBody Map<String, String> map) {
        System.out.println(map);
    }
}
